#define _CRT_SECURE_NO_WARNINGS 1
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>

int main()
{
	int a, b, s;
	while (~scanf("%d %d", &a, &b))
	{
		if (a > b)
		{
			int t = 0;
			t = a;
			a = b;
			b = t;
		}
		s = floor((b - a) * (sqrt(5) + 1) / 2);
		if (a == s) printf("0\n");
		else printf("1\n");
	}
	return 0;
}
//1113